by Oliver
13. June 2013 15:17
Some part of MVC 4 didn't like what was in my view:
1: @using Orchard.ContentManagement;
2: @using Orchard.Users.Models;
3: @{
4: var userCanRegister =
5: @WorkContext.CurrentSite.As<RegistrationSettingsPart>().UsersCanRegister;
6: var enableLostPassword =
7: @WorkContext.CurrentSite.As<RegistrationSettingsPart>().EnableLostPassword;
8: }
Turns out that the (incorrectly placed) @ signs in front of WorkContext were (finally) not swallowed silently anymore. Now, this works:
1: @using Orchard.ContentManagement;
2: @using Orchard.Users.Models;
3: @{
4: var userCanRegister =
5: WorkContext.CurrentSite.As<RegistrationSettingsPart>().UsersCanRegister;
6: var enableLostPassword =
7: WorkContext.CurrentSite.As<RegistrationSettingsPart>().EnableLostPassword;
8: }
It's just the error message that's a bit misleading.